package com.shangxia.monomer.business.base.controller;


import com.shangxia.monomer.business.base.entity.User;
import com.shangxia.monomer.business.base.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author shangxia
 * @since 2021-07-31
 */
@RestController
@RequestMapping("/base/user")
@Api()
@Slf4j
public class UserController {
    @Autowired
    private IUserService userService;

    @PostMapping("/queryAll")
    @ApiOperation("全部用户")
    public List<User> queryAll() {
        log.trace("hello===trace==");
        log.debug("hello===debug==");
        log.info("hello===info==");
        log.warn("hello===warn==");
        log.error("hello===error==");
        List<User> list = userService.list();
        log.warn("hello===warn=={}",list.size());
        log.debug("hello===debug=={}",list.size());
        log.info("hello===info=={}",list.size());
        log.error("hello===error=={}",list.size());
        return list;
    }

}
